<%@include file="/jsp/init.jspf" %>
<hunk:init autocompleter="true"/>
<layout:top/>
<hunk:validator form="purchaseForm">
    <hunk:form action="purchase?action=save" name="purchaseForm">
        <hunk:hidden name="id"/>
        <hunk:container>
            <table class="hundred">
                <tr>
                    <td>
                        <hunk:autocompletor name="item" styleClass="required" fields="itemCode" shouldMatch="true" value="${purchaseForm.purchase.item.description}"  query="SELECT_ITEM" container="NULL" label="Item"/>
                        <hunk:hidden name="itemCode" value="${purchaseForm.purchase.item.code}"/>
                    </td>
                    <td>
                        <hunk:text name="purchase.quantity" styleClass="required" container="NULL" label="Quantity"/>
                    </td>
                    <td>
                        <hunk:text name="purchase.amount" styleClass="required currency" container="NULL" label="Price"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <hunk:text name="purchase.weight" styleClass="weight" container="NULL" label="Weight"/> KGs
                    </td>
                    <td>
                        <hunk:text name="purchase.returnQantity" styleClass="currency" container="NULL" label="Return"/>
                    </td>
                    <td>
                        <hunk:text name="purchase.purchaseFrom" container="NULL" label="Purchase From"/>
                    </td>
                </tr>                
            </table>    
        </hunk:container>
        <div id="charge">
            <jsp:include page="charge.jsp"/>
        </div>
        <hunk:container>
            <table class="hundred">
                <tr>
                    <td colspan="3" align="center">
                        <br>
                        <hunk:link href="${path}/purchase.do?action=search" styleClass="float-left">Back</hunk:link>
                        <hunk:submit label="Save"/>
                    </td>
                </tr>
            </table>
        </hunk:container>
    </hunk:form>
</hunk:validator>
<layout:bottom/>
